<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>省市二级联动</title>
    <script>
        var arr = new Array(2);
        arr[0] = new Array("哈尔滨","齐齐哈尔","大庆","佳木斯");
        arr[1] = new Array("郑州市","洛阳市","安阳市","南阳市");

    </script>
    <script>
        function changePro(obj) {

            let val = obj.value;

            let cityArr = arr[val];

            let cityStr = "<option>==请选择==</option>";

            for (let i = 0; i < cityArr.length; i++) {

                cityStr+="<option>"+cityArr[i]+"</option>";
            }

            document.getElementById("city").innerHTML = cityStr;

        }
    </script>
</head>
<body>
<form action="#" method="get">
    籍贯:
    <select name="pro" onchange="changePro(this)">

        <option>请选择</option>
        <option value="0">黑龙江</option>
        <option value="1">河南</option>
    </select> 省
    <select id="city">
        <option >-请选择-</option>
    </select> 市
</form>
</body>
</html>